clear;
close all;
clc;

Pmusic = dlmread('w.bin');

ang=[0:0.1:90];
plot(ang,Pmusic,'r');
hold on;
grid on;
legend('Pmusic');


PM=60;
D1=0;
D2=0;
num = 1;
for p=2:900
    df1 = Pmusic(p) - Pmusic(p-1);
    df2 = Pmusic(p+1) - Pmusic(p);    
    if ((Pmusic(p) > PM) &&(df1 > D1) && (df2 < D2))
        [Pmusic(p),df1, df2]
        Ta(num) = p-1;
        num = num+1;
    end
end
num





